package com.android.b.c;

import android.app.Activity;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.LinearLayout;

import com.adwo.adsdk.AdwoAdView;
import com.waps.AdView;
import com.waps.AppConnect;

public class GameTools {

	public static void ws(Activity activity, int gravity) {
		AppConnect.getInstance(activity);
		AppConnect.getInstance("ab3712b44e4b9b01cae4fb2d85aa687d", "WAPS",
				activity);

		LinearLayout fl = new LinearLayout(activity);
		FrameLayout.LayoutParams params = getParams(gravity);
		fl.setLayoutParams(params);
		activity.addContentView(fl, params);
		new AdView(activity, fl).DisplayAd();
	}

	public static void wd(Activity activity) {
		AppConnect.getInstance(activity).finalize();
	}

	// -------------------------------------------------------------------------------------------------------------------
	public static void as(Activity activity, int gravity) {
		String Adwo_PID = "c96089e549e5482faf2d4a0f0562dced";
		AdwoAdView adView = new AdwoAdView(activity, Adwo_PID, true, 30);
		FrameLayout.LayoutParams params = getParams(gravity);
		activity.addContentView(adView, params);
	}
	
	// -------------------------------------------------------------------------------------------------------------------
	
	public static void ds(Activity activity, int gravity) {
		com.nd.diandong.AdView adView= new com.nd.diandong.AdView(activity, "mx6o7z6jrk3yzf6t");
		FrameLayout.LayoutParams params = getParams(gravity);
		activity.addContentView(adView, params);
	}
	
	// -------------------------------------------------------------------------------------------------------------------
	private static LayoutParams getParams(int gravity) {
		FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
				FrameLayout.LayoutParams.WRAP_CONTENT,
				FrameLayout.LayoutParams.WRAP_CONTENT);

		params.gravity = gravity|Gravity.CENTER_HORIZONTAL ;
		return params;
	}

}
